package com.wiloon.java8x.io.file;

import java.io.FileWriter;
import java.io.IOException;
import java.text.DecimalFormat;

/**
 * Created by Roy on 2015/9/15;
 */
public class TextFileWriter {
    public static void main(String[] args) {
        FileWriter fw = null;
        try {
            fw = new FileWriter("D:/Test.txt");
            for (int i = 0; i < 1000; i++) {
                String str = new DecimalFormat("0000").format(i);
                String s = "";
                fw.write(s);
                fw.write("\r\n");
            }
            fw.flush();
            fw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
